<!DOCTYPE html>
<html>

{include file='public/header'}

<body>
    <div class="x-nav">
        <span class="layui-breadcrumb">
            <a href="javascript:void(0)">首页</a>
            <a href="javascript:void(0)">短剧推广</a>
            <a><cite>默认充值数据</cite></a>
        </span>
        <a class="layui-btn layui-btn-small" id="reload" title="刷新">
            <i class="layui-icon" style="line-height:30px"><i class="iconfont">&#xe6aa;</i></i>
        </a>
    </div>
    <div class="x-body">
        <div class="layui-row">
            <form class="layui-form">
                <!-- <div class="layui-inline">
                    <label class="layui-form-label w-auto">使用平台：</label>
                    <div class="layui-input-inline">
                        <select name="platform_type" id="platform_type">
                            <option value="">请选择</option>
                            <option value="1">微信短剧</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div> -->
                <div class="layui-inline">
                    <label class="layui-form-label w-auto">展示对象：</label>
                    <div class="layui-input-inline">
                        <select name="display_object" id="display_object">
                            <option value="">请选择</option>
                            <option value="1">全部用户</option>
                            <option value="2">已充值用户</option>
                            <option value="3">未充值用户</option>
                        </select>
                    </div>
                </div>

                <button class="layui-btn" style="margin-left: 10px;" lay-submit lay-filter="searchList">搜索</button>
                <button type="reset" id="resetList" class="layui-btn layui-btn-primary">重置</button>
            </form>
        </div>
        <table id="link" lay-filter="link"></table>
    </div>

    <script>
        Ajax('/cps/recharge/getRechargeType', {type:0}).then(result => {
            let params = {
                elem: '#link'
                , toolbar: '#toolbarDemo'
                , url: '/cps/recharge/defaultCharge' //数据接口
                , id: 'link'
                , page:true
                , limit:15
                , cols: [[ //表头
                    {title: '使用平台', templet: function (d) {
                            return d.platform_type == 1 ? '微信短剧' : d.platform_type == 2 ? '抖音小程序' : '快应用'
                        }, align:'center'
                    }
                    , {title: '充值类型', templet: function (d) {
                            for (let index = 0; index < result.data.length; index++) {
                                const element = result.data[index];
                                if(element.id == d.type){
                                    return element.name
                                }
                            }
                        }, align:'center'
                    }
                    , { field: 'name', title: '充值金额名', align:'center' }
                    , { field: 'label', title: '标签', align:'center' }

                    , {title: '展示对象', templet: function (d) {
                            return d.display_object == 1 ? '全部用户' : d.display_object == 2 ? '已充值用户' : '未充值用户'
                        }, align:'center'
                    }
                    , { field: 'recharge_price', title: '充值金额', align:'center' }
                    , { field: 'original_currency', title: '充值币数', align:'center' }
                    
                    , { field: 'send_currency', title: '赠送币数', align:'center' }
                    , { field: 'send_title', title: '赠送标语', align:'center' }
                ]]
            }
            tableList(params)
        })
        

    </script>
</body>

</html>